package com.jikedaquan.game.jwt.service;

import com.jikedaquan.game.jwt.entity.Exercise;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jikedaquan.game.jwt.entity.User;

import java.util.Date;

/**
 * <p>
 * 修炼记录 服务类
 * </p>
 *
 * @author jiake
 * @since 2019-10-31
 */
public interface ExerciseService extends IService<Exercise> {

    /**
     * 开始修炼
     * @param user
     * @return
     */
    boolean start(User user);

    /**
     * 获取最近一条修炼记录
     * @param user
     * @return
     */
    Exercise getCurrentExercise(User user);

    /**
     * 根据给定时间计算出修炼状态
     * @param startTime
     * @return
     */
    String getExerciseStatusStr(Date startTime);

    /**
     * 停止修炼并进行结算
     * @param user
     * @return
     */
    Exercise stop(User user);
}
